package com.homejoy.system.service.impl;

import java.util.List;

import com.homejoy.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.homejoy.system.mapper.HomejoyWalletMapper;
import com.homejoy.system.domain.HomejoyWallet;
import com.homejoy.system.service.IHomejoyWalletService;

/**
 * 钱包Service业务层处理
 *
 * @author homeJoy
 * @date 2025-11-08
 */
@Service
public class HomejoyWalletServiceImpl implements IHomejoyWalletService {
    @Autowired
    private HomejoyWalletMapper homejoyWalletMapper;

    /**
     * 查询钱包
     *
     * @param walletId 钱包主键
     * @return 钱包
     */
    @Override
    public HomejoyWallet selectHomejoyWalletByWalletId(Long walletId) {
        return homejoyWalletMapper.selectHomejoyWalletByWalletId(walletId);
    }

    /**
     * 查询钱包列表
     *
     * @param homejoyWallet 钱包
     * @return 钱包
     */
    @Override
    public List<HomejoyWallet> selectHomejoyWalletList(HomejoyWallet homejoyWallet) {
        return homejoyWalletMapper.selectHomejoyWalletList(homejoyWallet);
    }

    /**
     * 新增钱包
     *
     * @param homejoyWallet 钱包
     * @return 结果
     */
    @Override
    public int insertHomejoyWallet(HomejoyWallet homejoyWallet) {
        homejoyWallet.setCreateTime(DateUtils.getNowDate());
        return homejoyWalletMapper.insertHomejoyWallet(homejoyWallet);
    }

    /**
     * 修改钱包
     *
     * @param homejoyWallet 钱包
     * @return 结果
     */
    @Override
    public int updateHomejoyWallet(HomejoyWallet homejoyWallet) {
        homejoyWallet.setUpdateTime(DateUtils.getNowDate());
        return homejoyWalletMapper.updateHomejoyWallet(homejoyWallet);
    }

    /**
     * 批量删除钱包
     *
     * @param walletIds 需要删除的钱包主键
     * @return 结果
     */
    @Override
    public int deleteHomejoyWalletByWalletIds(Long[] walletIds) {
        return homejoyWalletMapper.deleteHomejoyWalletByWalletIds(walletIds);
    }

    /**
     * 删除钱包信息
     *
     * @param walletId 钱包主键
     * @return 结果
     */
    @Override
    public int deleteHomejoyWalletByWalletId(Long walletId) {
        return homejoyWalletMapper.deleteHomejoyWalletByWalletId(walletId);
    }
}
